#ifndef P2P_CLIENT_PROTO_H_
#define P2P_CLIENT_PROTO_H_

#define REGISTER            0x0001
#define LOGIN               0x0002
#define REGISTER_ACK        0x0003
#define LOGIN_ACK           0x0004
#define HEART_BEAT          0x0005
#define HEART_BEAT_ACK      0x0006
#define ONLINE_LIST         0x0007
#define ONLINE_LIST_ACK     0x0008
#define P2P_REQUST          0x0009
#define P2P_RESPONSE        0x000a
#define P2P_CONNECT         0x000b
#define P2P_CONNECT_ACK     0x000c
#define P2P_MASSAGE         0x000d
#define P2P_TRANS_CON       0x000e
#define P2P_TRANS_CON_ACK   0x000f
#define LOGOUT              0x0010
#define LOGOUT_ACK          0x0011
#define P2P_TRANS_MSG       0x0012
#define FRIEND_LIST         0x0013
#define FRIEND_LIST_ACK     0x0014
#define FRIEND_CTL          0x0015
#define FRIEND_CTL_ACK      0x0016
#define P2P_TRANS_FILE      0x001b
#define P2P_FILE            0x001d

#define SA  struct sockaddr
#define SAI struct sockaddr_in
#define IA  struct in_addr

#define SERV_PORT 9999
#define BUF_SIZE 1024
#define LEN 20
#define maxInt (1 << 31)

struct msgHead
{
    unsigned long cmd;
    unsigned long length;
    unsigned long error;
};

#endif
